import Types from '../../action/types';

const defaultState = {};


export default function onAction(state = defaultState, action){
    switch (action.type) {
        case Types.LOAN_DATA_LIST_REFRESH:
            return {
                ...state,
                [action.storeName]:{
                    ...state[action.storeName],
                    isLoading: true,
                }
            }
        case Types.LOAN_DATA_LIST_SUCCESS:
            return {
                ...state,
                [action.storeName]:{
                    ...state[action.storeName],
                    applyData:action.applyData,
                    projectModels:action.projectModels,
                    isLoading: false,
                }
            }
        case Types.LOAN_DATA_LIST_FAIL://获取数据失败
            return {
                ...state,
                [action.storeName]: {
                    ...state[action.storeName],
                    isLoading: false,
                }
            };
        default:
            return state
    }
}  